# https://gitee.com/yueyinqiu5990/codes-for-tj10053104/blob/master/supplement1/question8/col_index.py


def to_number_index(string_index: str, index_base: int = 0) -> int:
    result = 0
    for c, p in zip(string_index, range(len(string_index) - 1, -1, -1)):
        num = ord(c) - ord("A") + 1
        result += num * (26 ** p)
    return result - 1 + index_base


def _main():
    input_string = input("列名(AA-ZZ):")
    print("第", to_number_index(input_string, index_base=1), "列")


if __name__ == "__main__":
    _main()
